<template>
	<view style="display: flex;flex-direction: column;flex: 1;">
		<zy-update
			ref="zyupgrade"
			theme="green"
			:h5preview="true"
			oldversion="1.0.2"
			:appstoreflag="false"
			:updateurl="update_url"
			:showupdateTips="showupdatetips"
			:noticeflag="true"
		></zy-update>
		<button type="default" @tap="update">点击更新</button>
	</view>
</template>

<script>
import ZyUpdate from '@/components/zy-upgrade/zy-upgrade.vue';
export default {
	data() {
		return {
			update_url: 'https://7a3e3fa9-7820-41d0-be80-11927ac2026c.bspapp.com/http/update'
		};
	},
	components: {
		ZyUpdate
	},
	onReady() {
		this.$refs.zyupgrade.dshow = true;
	},
	methods: {
		// 检查更新
		update(){
			this.$refs.zyupgrade.check_update()
		},
		showupdatetips(flag){
			if(flag == 0){
				uni.showToast({
					title: '已经是最新版本了',
					icon:'none'
				});
			}
		}
	}
};
</script>

<style lang="scss"></style>
